using AutoMapper;
using Pay.DTO;
using Pay.Data;
using Pay.IService;
using Pay.Core;

namespace Pay.Service.AutoMapper {
	public class TransferBatchMapper : IStartupDto {
		private IMapperConfigurationExpression _cfg;
		public TransferBatchMapper(IMapperConfigurationExpression cfg) {
			_cfg = cfg;
		}
		public void Execute() {
			Create();
		}
		protected virtual void Create() {
			_cfg.CreateMap<TransferBatch, transfer_batch_dto>()
				.ForMember(dest => dest.pay_channel, src => src.MapFrom(c => c.PayChannel))
				.ForMember(dest => dest.back_file, src => src.MapFrom(c => c.BackFile))
				.ForMember(dest => dest.batch_file, src => src.MapFrom(c => c.BatchFile))
				.ForMember(dest => dest.notice_tran_no, src => src.MapFrom(c => c.NoticeTranId))
				.ForMember(dest => dest.batch_no, src => src.MapFrom(c => c.BatchNo))
				.ForMember(dest => dest.merchant_id, src => src.MapFrom(c => c.MerchantId));
		}
	}
}
